// 0. 抽象类一般作为父类使用
// 1. 抽象类规定不能直接实例化
// 2. 抽象类干的活类似interfa接口，只不过接口用于描述对象的属性类型 而它可以描述属性的工作内容
// 3. abstract关键字用于定义抽象类或者抽象方法
// 4. 抽象类中的抽象方法不能直接定义而应该像接口一样只能描述签名，并且抽象方法必须在子类中实现

abstract class Department {
  constructor(public name: string) {}
  printName(): void {
    console.log('Department name:' + this.name);
  }
  abstract printMetting(): void
}
class AccountingDepartment extends Department {
  constructor() {
    super('Accountting and auditing')
  }
  printMetting(): void {
    console.log('The Accounting Department meets each Monday at 10am.')
  }
  generateReports(): void {
    console.log(' Generating accounting reports...')
  }
}
// let department: Department
// department = new Department() // 报错：无法实例化一个抽象类
let department = new AccountingDepartment()
department.printName() // 'Department name:Accountting and auditing'
department.printMetting() // 'The Accounting Department meets each Monday at 10am.'
department.generateReports() // 'Generating accounting reports...'
